<template>
    <div class="centerBox">
        <ul class="centerTop">
            <li class="liB">
                <p class="biaoNum t1">
                    {{ numberFormat(indexData.index1).value }}
                    <span class="unit">
                        {{ numberFormat(indexData.index1).unit }}</span
                    >
                </p>
                <p class="biao">本年收入(￥)</p>
            </li>
            <li class="liB">
                <p class="biaoNum t2">
                    {{ numberFormat(indexData.index2).value }}
                    <span class="unit">
                        {{ numberFormat(indexData.index2).unit }}</span
                    >
                </p>
                <p class="biao">累计出口($)</p>
            </li>
            <li class="liB">
                <p class="biaoNum t3">
                    {{ indexData.index3 }} <span class="unit">个</span>
                </p>
                <p class="biao">国家和地区</p>
            </li>
            <li class="liB">
                <p class="biaoNum t4">
                    {{ indexData.index4 }} <span class="unit">家</span>
                </p>
                <p class="biao">服务企业</p>
            </li>
            <li class="liB">
                <p class="biaoNum t5">
                    {{ indexData.index5 }} <span class="unit">家</span>
                </p>
                <p class="biao">成员公司</p>
            </li>
            <li class="liB">
                <p class="biaoNum t6">
                    {{ indexData.index6 }} <span class="unit">人</span>
                </p>
                <p class="biao">员工人数</p>
            </li>
        </ul>
        <div class="map-container">
            <ul class="mapArr">
                <li class="mapItem">
                    <div
                        class="mapItemBox"
                        :style="{
                            opacity: gsFlag ? 0 : 1,
                            'z-index': gsFlag ? '1' : '5'
                        }"
                    >
                        <div class="mapBB">
                            <img src="@/assets/cockpit/botBB.png" alt="" />
                        </div>
                        <div class="borderqq"></div>
                        <div class="mapglbg" v-if="isshowWorld > 0"></div>
                        <!-- 图例 -->
                        <ul class="elaphes">
                            <li
                                v-for="(item, index) in worldInfo"
                                :key="index"
                                @click="openWorld(item.name)"
                            >
                                <div
                                    class="circle"
                                    :style="{ 'background-color': item.color }"
                                ></div>
                                <p>{{ item.name }}</p>
                            </li>
                        </ul>
                        <!-- 坐标 -->
                        <ul class="worldUl">
                            <li
                                :class="[
                                    'worldLi',
                                    item.id == worldId ? 'showl' : ''
                                ]"
                                v-for="item in worldInfo"
                                :key="item.id"
                                :style="{
                                    left: item.left + 'px',
                                    top: item.top + 'px'
                                }"
                            >
                                <p class="worldLiName">{{ item.name }}</p>
                                <div class="worldLiIcon">
                                    <img src="@/assets/cockpit/gsactive.png" />
                                </div>
                            </li>
                        </ul>
                        <!--弹出框  -->
                        <div
                            v-for="item in worldInfo"
                            :key="item.id"
                            style="width: 100%; height: 100%"
                        >
                            <div class="worldDilog" v-if="item.id == worldId">
                                <p class="titlew">{{ item.name }}</p>
                                <p class="titlev">
                                    国家数：<span class="colorR">{{
                                        item.value1
                                    }}</span>
                                </p>
                                <p class="titlev">
                                    本年出口数：<span class="colorR">
                                        {{ numberFormat(item.value4).value }}
                                        {{ numberFormat(item.value4).unit }}
                                        ({{ item.value5 }}%)</span
                                    >
                                </p>
                                <p class="titlev">
                                    累计出口数：<span class="colorR">
                                        {{ numberFormat(item.value2).value }}
                                        {{ numberFormat(item.value2).unit }}
                                    </span>
                                </p>
                            </div>
                        </div>
                    </div>
                    <div
                        class="mapItemBoxdis"
                        :style="{
                            opacity: gsFlag ? 1 : 0,
                            'z-index': gsFlag ? '5' : '1'
                        }"
                    >
                        <p class="mapItemBoxP">
                            {{ CompanyTotalRevenue.name }}
                        </p>
                        <ul class="mapItemBoxinfo">
                            <li class="mapItemBoxii">
                                <p>
                                    本年营收：<span class="num">{{
                                        numberFormat(CompanyTotalRevenue.value1)
                                            .value
                                    }}</span
                                    ><span class="unit"
                                        >{{
                                            numberFormat(
                                                CompanyTotalRevenue.value1
                                            ).unit
                                        }}
                                        元</span
                                    >
                                </p>
                            </li>
                            <li class="mapItemBoxii">
                                <p>
                                    去年营收：<span class="num">{{
                                        numberFormat(CompanyTotalRevenue.value2)
                                            .value
                                    }}</span
                                    ><span class="unit"
                                        >{{
                                            numberFormat(
                                                CompanyTotalRevenue.value2
                                            ).unit
                                        }}元</span
                                    >
                                </p>
                            </li>
                        </ul>

                        <div class="chartIobox1">
                            <div
                                id="centerChart1"
                                style="width: 100%; height: 120px"
                            ></div>
                        </div>
                        <ul class="mapItemBoxinfo">
                            <li class="mapItemBoxii">
                                <p>
                                    本年出口：<span class="num">{{
                                        numberFormat(CompanyTotalExport.value1)
                                            .value
                                    }}</span
                                    ><span class="unit"
                                        >{{
                                            numberFormat(
                                                CompanyTotalExport.value1
                                            ).unit
                                        }}美元</span
                                    >
                                </p>
                            </li>
                            <li class="mapItemBoxii">
                                <p>
                                    去年出口：<span class="num">{{
                                        numberFormat(CompanyTotalExport.value2)
                                            .value
                                    }}</span
                                    ><span class="unit"
                                        >{{
                                            numberFormat(
                                                CompanyTotalExport.value2
                                            ).unit
                                        }}美元</span
                                    >
                                </p>
                            </li>
                        </ul>
                        <div class="chartIobox2">
                            <div
                                id="centerChart2"
                                style="width: 100%; height: 120px"
                            ></div>
                        </div>
                    </div>
                </li>
                <li class="mapItem">
                    <div
                        class="mapItemBox"
                        :style="{
                            opacity: worldFlag ? 0 : 1,
                            'z-index': worldFlag ? '1' : '5'
                        }"
                    >
                        <div class="mapname">各运营中心经营数据</div>
                        <div class="mapzjbg">
                            <!-- 弹出框 -->
                            <div class="sonDilog" v-if="activeName">
                                <div>
                                    <div class="sonDilogtop">
                                        <img
                                            src="@/assets/cockpit/Box.png"
                                            alt=""
                                        />
                                        <p class="sonName">{{ activeName }}</p>
                                    </div>

                                    <p class="confirmT">本年营收：</p>
                                    <dv-digital-flop
                                        :config="config"
                                        v-if="activeName"
                                        style="
                                            width: 100px;
                                            height: 20px;
                                            margin-left: 40px;
                                        "
                                    />
                                </div>
                            </div>
                            <ul class="goslist">
                                <li
                                    :class="[
                                        'gositem',
                                        item.id == activeId ? 'active' : ''
                                    ]"
                                    v-for="item in gosInfo"
                                    :key="item.id"
                                    :style="{
                                        left: item.left + 'px',
                                        top: item.top + 'px'
                                    }"
                                    @click="tapGsin(item.name)"
                                >
                                    <p class="itemname">{{ item.name }}</p>
                                    <div
                                        class="itemicon"
                                        v-if="item.id == activeId"
                                    >
                                        <img
                                            src="@/assets/cockpit/gsactive.png"
                                            alt=""
                                        />
                                    </div>
                                    <div class="itemicon" v-else>
                                        <img
                                            src="@/assets/cockpit/gs.png"
                                            alt=""
                                        />
                                    </div>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <div
                        class="mapItemBoxdis"
                        :style="{
                            opacity: worldFlag ? 1 : 0,
                            'z-index': worldFlag ? '5' : '1'
                        }"
                    >
                        <p class="mapItemBoxP dis">{{ worldZYname }}</p>
                        <p class="textINfo">{{ OrganizationDescribe }}</p>
                        <p class="mapItemBoxP dis">国家排名</p>
                        <div class="chartIobox3">
                            <div
                                id="centerChart3"
                                style="width: 100%; height: 120px"
                            ></div>
                        </div>
                        <p class="mapItemBoxP dis">组织月度数据</p>
                        <div class="chartIobox4">
                            <div
                                id="centerChart4"
                                style="width: 100%; height: 110px"
                            ></div>
                        </div>
                    </div>
                </li>
            </ul>
            <div class="mapRoll">
                <div class="rolltext">
                    <span class="water_text"
                        >外贸综合服务为核心的产业供应链集成服务，以数字生活服务为核心的消费品供应链集成服务</span
                    >
                </div>
            </div>
            <div class="recheck" @click="changeinit"></div>
        </div>
    </div>
</template>
  
  <script>
// import * as echarts from 'echarts'
// import WorldJson from '@/assets/json/worlds.json'
import {
    screenMidData,
    screenMidCompanyData,
    screenMidOrganizationData
} from '@/api/cockpit.js'
export default {
    data() {
        return {
            // 指标
            indexData: {
                index1: 0,
                index2: 0,
                index3: 0,
                index4: 0,
                index5: 0,
                index6: 0
            },
            // 地图图片
            coverImgUrl: '', // 背景图片的地址，
            gosInfo: [
                // {
                //     top: 174,
                //     value1: 57.74,
                //     left: 222,
                //     name: '台州运营中心',
                //     id: 1
                // },
                // {
                //     top: 33,
                //     value1: 5.05,
                //     left: 181,
                //     name: '嘉兴运营中心',
                //     id: 2
                // },
                // {
                //     top: 68,
                //     value1: 9.73,
                //     left: 120,
                //     name: '杭州运营中心',
                //     id: 3
                // },
                // {
                //     top: 236,
                //     value1: 8.58,
                //     left: 175,
                //     name: '温处运营中心',
                //     id: 4
                // },
                // {
                //     top: 10,
                //     value1: 14.18,
                //     left: 118,
                //     name: '湖州运营中心',
                //     id: 5
                // },
                // {
                //     top: 127,
                //     value1: 1.43,
                //     left: 131,
                //     name: '金华运营中心',
                //     id: 6
                // }
            ],
            activeId: 1,
            activeTimer: null,
            activeName: '',
            activeMoney: 0,
            worldInfo: [
                // {
                //     name: 'RCEP', // 1
                //     left: 102,
                //     top: 115,
                //     id: 1
                // },
                // {
                //     name: '东盟', //2
                //     left: 178,
                //     top: 87,
                //     id: 2
                // },
                // {
                //     name: '一带一路', //3
                //     left: 143,
                //     top: 24,
                //     id: 3
                // }
                // {
                //     name: '欧盟',
                //     left: 168,
                //     top: 7,
                //     id: 4
                // }
            ],
            worldId: 0,
            worldTimer: null,
            worldName: '',
            worldVal1: '',
            worldVal2: '',
            worldVal3: '',
            worldVal4: '',
            worldVal5: '',
            config: {
                number: [],
                content: '{nt}亿元',
                toFixed: 2,
                animationFrame: 50,
                animationCurve: 'easeOutQuart',
                style: {
                    fontSize: 19,
                    fill: '#04ccff'
                    // fontFamily: 'Yourname'
                }
            },
            centerChart1: null, //图表对象
            centerChart1data: {},
            centerChart2: null, //图表对象
            centerChart2data: {},
            gsFlag: false, //切换
            CompanyTotalExport: {
                name: '',
                value1: '',
                value2: ''
            },
            CompanyTotalRevenue: {
                name: '',
                value1: '',
                value2: ''
            },
            timeoutInit1: null,
            timeoutInit2: null,
            timeoutInit3: null,
            timeoutInit4: null,
            timeoutInit5: null,
            timeoutInit6: null,
            timeoutInit7: null,
            timeoutInit8: null,
            isshowWorld: false, //地球显隐
            centerChart3: null, //图表对象
            centerChart3data: {},
            centerChart4: null, //图表对象
            centerChart4data: {},
            worldFlag: false, //切换
            OrganizationDescribe: '',
            worldZYname: ''
        }
    },
    mounted() {
        this.CenterChartgetall()
    },
    computed: {
        bgStyle() {
            return {
                backgroundImage: 'url(' + this.coverImgUrl + ')'
            }
        }
    },
    methods: {
        CenterChartgetall(data) {
            screenMidData().then((res) => {
                // 指标
                this.indexData = { ...res.data.Index }
                // 子公司
                this.gosInfo = res.data.ZhejiangMap.map((item, index) => {
                    let obj = {
                        name: item.name,
                        top: item.top,
                        left: item.left,
                        id: index + 1,
                        value1: item.value1
                    }
                    return obj
                })
                this.isshowWorld = true
                this.activeName = this.gosInfo[0].name
                this.activeId = this.gosInfo[0].id
                this.activeMoney = this.gosInfo[0].value1
                this.config.number = [this.activeMoney]
                this.config = { ...this.config }
                // 开启循环
                this.loopActive()
                // 世界联盟
                let cocorloA = [
                    '#0090FC',
                    '#60C967',
                    '#F1B927',
                    '#ee6666',
                    '#D4394D',
                    '#8C42A6',
                    '#53A88B'
                ]

                this.worldInfo = res.data.WorldMap.map((item, index) => {
                    let obj = {
                        name: item.name,
                        top: item.top,
                        left: item.left,
                        id: index + 1,
                        color: cocorloA[index],
                        value1: item.value1,
                        value2: item.value2,
                        value3: item.value3,
                        value4: item.value4,
                        value5: item.value5
                    }
                    return obj
                })
                // 开启循环
                this.loopWorld()
                this.loopWorldActive()
            })
        },
        // 循环高亮
        loopActive() {
            let sonNum = this.gosInfo.length
            this.activeTimer = setInterval(() => {
                this.activeId += 1
                if (this.activeId > sonNum) {
                    this.activeId = 1
                }
                this.activeName = this.gosInfo[this.activeId - 1].name
                this.activeId = this.gosInfo[this.activeId - 1].id
                this.activeMoney = this.gosInfo[this.activeId - 1].value1
                this.config.number = [this.activeMoney]
                this.config = { ...this.config }
            }, 10000)
        },

        // 转换单位
        numberFormat(val) {
            let value = val - 0
            let param = {}
            let k = 10000
            let sizes = ['', '万', '亿', '万亿']
            let i = 0
            if (value < k) {
                param.value = value
                param.unit = ''
            } else {
                i = Math.floor(Math.log(value) / Math.log(k))
                param.value = (value / Math.pow(k, i)).toFixed(2)
                param.unit = sizes[i]
            }
            return param
        },
        // 转换单位
        keepTwoDecimalFull(num) {
            if (num > 10000) {
                let result = num / 10000
                result = Math.floor(result * 100) / 100
                var s_x = result.toString() //将数字转换为字符串
                var pos_decimal = s_x.indexOf('.') //小数点的索引值// 当整数时，pos_decimal=-1 自动补0
                if (pos_decimal < 0) {
                    pos_decimal = s_x.length
                    s_x += '.'
                } // 当数字的长度< 小数点索引+2时，补0
                while (s_x.length <= pos_decimal + 2) {
                    s_x += '0'
                }
                s_x += '万'
            } else {
                s_x = num
            }
            return s_x
        },
        loopWorldActive() {
            // 一个周期持续时间86s
            this.worldTimer = setInterval(() => {
                this.loopWorld()
            }, 86000)
        },
        // 地球转转转
        loopWorld() {
            let _this = this
            console.log('RCEP')
            this.worldId = 1
            this.timeoutInit1 = setTimeout(() => {
                this.changetool1()
            }, 10000)
        },
        // 第一次自转
        changetool1() {
            let _this = this
            return new Promise((resolve, reject) => {
                _this.worldId = 0
                console.log('转')
                // 第一次自转持续时间6s
                this.timeoutInit2 = setTimeout(() => {
                    console.log('东盟')
                    this.worldId = 2
                    resolve()
                }, 6000)
            }).then(() => {
                // 10S后准备第二次自转
                return this.changetool2().then(() => {
                    return this.changetool3().then(() => {
                        return this.changetool4().then(() => {
                            return this.changetool5().then(() => {
                                return this.changetool6().then(() => {
                                    return this.changetool7()
                                })
                            })
                        })
                    })
                })
            })
        },
        changetool2() {
            let _this = this
            return new Promise((resolve, reject) => {
                this.timeoutInit3 = setTimeout(() => {
                    // 第二次转
                    _this.worldId = 0
                    console.log('转')
                    resolve()
                }, 9000)
            })
        },
        changetool3() {
            let _this = this
            // 进行第二次自转10s
            return new Promise((resolve, reject) => {
                this.timeoutInit4 = setTimeout(() => {
                    _this.worldId = 3
                    console.log('一带一路')
                    resolve()
                }, 10000)
            })
        },
        changetool4() {
            let _this = this
            // 持续9s后进行第三次自转
            return new Promise((resolve, reject) => {
                this.timeoutInit5 = setTimeout(() => {
                    _this.worldId = 0
                    console.log('转')
                    resolve()
                }, 9000)
            })
        },
        changetool5() {
            let _this = this
            // 持第三次自转5s
            return new Promise((resolve, reject) => {
                this.timeoutInit6 = setTimeout(() => {
                    _this.worldId = 4
                    console.log('欧盟')
                    resolve()
                }, 5000)
            })
        },
        changetool6() {
            let _this = this
            // 持续8s后进行第4次自转
            return new Promise((resolve, reject) => {
                this.timeoutInit7 = setTimeout(() => {
                    _this.worldId = 0
                    console.log('转')
                    resolve()
                }, 8000)
            })
        },
        changetool7() {
            let _this = this
            // 持第4次自转28s
            return new Promise((resolve, reject) => {
                this.timeoutInit8 = setTimeout(() => {
                    _this.worldId = 1
                    console.log('RCEP')
                    resolve()
                }, 28000)
            })
        },
        // 点击选中
        tapGsin(name) {
            this.gsFlag = true
            screenMidCompanyData({
                name: name
            }).then((res) => {
                this.centerChart1data = res.data.CompanyRevenue.line
                this.drawcenterChart1()
                this.centerChart2data = res.data.CompanyExport.line
                this.drawcenterChart2()
                this.CompanyTotalExport = res.data.CompanyTotalExport
                this.CompanyTotalRevenue = res.data.CompanyTotalRevenue
            })
        },

        drawcenterChart1() {
            this.centerChart1 = this.$echarts.init(
                document.getElementById('centerChart1')
            )
            let option = {
                color: ['#91cc75', '#1672FD'],
                tooltip: {
                    trigger: 'axis'
                },

                toolbox: {
                    show: true
                },
                legend: {
                    top: '-1',
                    right: '2%',
                    // x: '50%',
                    textStyle: {
                        fontSize: 14,
                        color: '#B4B4B4'
                    },
                    show: true
                },
                grid: {
                    left: '0%',
                    right: '2%',
                    bottom: '0%',
                    top: '8%',
                    containLabel: true
                },
                xAxis: {
                    type: 'category',
                    boundaryGap: false, //是否从0刻度开始绘制
                    axisLine: {
                        show: false,
                        lineStyle: {
                            color: '#618AB8'
                        }
                    },
                    axisLabel: {
                        // interval: 1, //横轴信息全部显示
                        // rotate: 40, //-30度角倾斜显示
                        color: '#618AB8', //坐标的字体颜色
                        fontSize: 14
                    },
                    axisTick: {
                        show: false
                    },
                    splitLine: {
                        show: false
                    },
                    data: this.centerChart1data.xAxis.map((item) => {
                        return item + '月'
                    })
                },
                yAxis: {
                    type: 'value',
                    // name: '单位（万元）',
                    // scale: true,
                    boundaryGap: true,
                    nameTextStyle: {
                        color: '#618AB8',
                        nameLocation: 'start'
                    },
                    axisLabel: {
                        color: '#618AB8', //坐标的字体颜色
                        fontSize: 14,
                        formatter: function (value, index) {
                            if (value === 0) {
                                return '0'
                            } else {
                                return value
                            }
                        }
                    },
                    splitLine: {
                        show: false,
                        //  改变轴线颜色
                        lineStyle: {
                            // 使用深浅的间隔色
                            color: ['rgba(0,114,255,0.2)']
                        }
                    }
                },
                series: [
                    {
                        name: this.centerChart1data.series[0].name,
                        type: 'line',
                        smooth: false,
                        itemStyle: {
                            color: '#91cc75',
                            lineStyle: {
                                color: '#91cc75',
                                width: '1'
                            }
                        },

                        data: this.centerChart1data.series[0].data
                    },
                    {
                        name: this.centerChart1data.series[1].name,
                        type: 'line',
                        smooth: false,
                        itemStyle: {
                            color: '#1672FD',
                            lineStyle: {
                                color: '#1672FD',
                                width: '1'
                            }
                        },

                        data: this.centerChart1data.series[1].data
                    }
                ]
            }
            this.centerChart1.setOption(option)
        },
        drawcenterChart2() {
            this.centerChart2 = this.$echarts.init(
                document.getElementById('centerChart2')
            )
            let option = {
                color: ['#91cc75', '#1672FD'],
                tooltip: {
                    trigger: 'axis'
                },

                toolbox: {
                    show: true
                },
                legend: {
                    top: '-1',
                    right: '2%',
                    // x: '50%',
                    textStyle: {
                        fontSize: 14,
                        color: '#B4B4B4'
                    },
                    show: true
                },
                grid: {
                    left: '0%',
                    right: '2%',
                    bottom: '0%',
                    top: '8%',
                    containLabel: true
                },
                xAxis: {
                    type: 'category',
                    boundaryGap: false, //是否从0刻度开始绘制
                    axisLine: {
                        show: false,
                        lineStyle: {
                            color: '#618AB8'
                        }
                    },
                    axisLabel: {
                        // interval: 1, //横轴信息全部显示
                        // rotate: 40, //-30度角倾斜显示
                        color: '#618AB8', //坐标的字体颜色
                        fontSize: 14
                    },
                    axisTick: {
                        show: false
                    },
                    splitLine: {
                        show: false
                    },
                    data: this.centerChart2data.xAxis.map((item) => {
                        return item + '月'
                    })
                },
                yAxis: {
                    type: 'value',
                    // name: '单位（万元）',
                    // scale: true,
                    boundaryGap: true,
                    nameTextStyle: {
                        color: '#618AB8',
                        nameLocation: 'start'
                    },
                    axisLabel: {
                        color: '#618AB8', //坐标的字体颜色
                        fontSize: 14,
                        formatter: function (value, index) {
                            if (value === 0) {
                                return '0'
                            } else {
                                return value
                            }
                        }
                    },
                    splitLine: {
                        show: false,
                        //  改变轴线颜色
                        lineStyle: {
                            // 使用深浅的间隔色
                            color: ['rgba(0,114,255,0.2)']
                        }
                    }
                },
                series: [
                    {
                        name: this.centerChart2data.series[0].name,
                        type: 'line',
                        smooth: false,
                        itemStyle: {
                            color: '#91cc75',
                            lineStyle: {
                                color: '#91cc75',
                                width: '1'
                            }
                        },

                        data: this.centerChart2data.series[0].data
                    },
                    {
                        name: this.centerChart2data.series[1].name,
                        type: 'line',
                        smooth: false,
                        itemStyle: {
                            color: '#1672FD',
                            lineStyle: {
                                color: '#1672FD',
                                width: '1'
                            }
                        },

                        data: this.centerChart2data.series[1].data
                    }
                ]
            }
            this.centerChart2.setOption(option)
        },
        // 世界图例
        openWorld(name) {
            this.worldFlag = true
            this.worldZYname = name
            screenMidOrganizationData({ name: name }).then((res) => {
                this.centerChart3data = res.data.CountrySort.line
                this.drawcenterChart3()
                let xAxisdata4 = res.data.OrganizationData.line.xAxis.map(
                    (item) => {
                        return item + '月'
                    }
                )
                let seriesdata4 = res.data.OrganizationData.line.series.map(
                    (item) => {
                        let obj = {
                            name: item.name,
                            type: 'bar',
                            barWidth: 11,
                            barGap: '0%',
                            emphasis: {
                                focus: 'series'
                            },
                            data: item.data
                        }
                        return obj
                    }
                )
                this.drawcenterChart4(xAxisdata4, seriesdata4)
                this.OrganizationDescribe = res.data.OrganizationDescribe.value
            })
        },
        drawcenterChart3() {
            this.centerChart3 = this.$echarts.init(
                document.getElementById('centerChart3')
            )
            let option = {
                color: ['#91cc75', '#1672FD'],
                tooltip: {
                    trigger: 'axis'
                },

                toolbox: {
                    show: true
                },
                legend: {
                    top: '-1',
                    right: '2%',
                    // x: '50%',
                    textStyle: {
                        fontSize: 14,
                        color: '#B4B4B4'
                    },
                    show: true
                },
                grid: {
                    left: '0%',
                    right: '2%',
                    bottom: '0%',
                    top: '8%',
                    containLabel: true
                },
                xAxis: {
                    type: 'category',
                    // boundaryGap: false,
                    axisLine: {
                        show: true,
                        lineStyle: {
                            color: '#35527C'
                        }
                    },
                    axisLabel: {
                        interval: 0, //横轴信息全部显示
                        rotate: 40, //-30度角倾斜显示
                        color: '#8697BA', //坐标的字体颜色
                        fontSize: 12
                    },
                    axisTick: {
                        show: false
                    },
                    data: this.centerChart3data.xAxis.map((item) => {
                        return item
                    })
                },
                yAxis: {
                    axisLine: {
                        show: true,
                        lineStyle: {
                            color: '#35527C'
                        }
                    },
                    type: 'value',

                    axisLabel: {
                        color: '#8697BA', //坐标的字体颜色
                        fontSize: 12
                    },
                    splitLine: {
                        show: false,
                        //  改变轴线颜色
                        lineStyle: {
                            // 使用深浅的间隔色
                            color: ['#35527C']
                        }
                    }
                },
                series: [
                    {
                        type: 'bar',
                        barWidth: 11,
                        barGap: '0%',
                        emphasis: {
                            focus: 'series'
                        },
                        itemStyle: {
                            color: '#91cc75'
                        },

                        data: this.centerChart3data.series
                    }
                ]
            }
            this.centerChart3.setOption(option)
        },
        drawcenterChart4(xAxisdata, seriesdata) {
            this.centerChart4 = this.$echarts.init(
                document.getElementById('centerChart4')
            )
            let option = {
                color: ['#FDA86A', '#1672FD'],

                tooltip: {
                    trigger: 'axis',
                    axisPointer: {
                        type: 'cross',
                        label: {
                            backgroundColor: '#6a7985'
                        }
                    }
                },
                legend: {
                    top: '0',
                    right: '2%',
                    orient: 'vertical',
                    // x: '50%',
                    textStyle: {
                        fontSize: 14,
                        color: '#B4B4B4'
                    },
                    show: true
                },
                grid: {
                    left: '0%',
                    right: '0%',
                    bottom: '0%',
                    top: '5%',
                    containLabel: true
                },
                xAxis: [
                    {
                        type: 'category',
                        // boundaryGap: false,
                        axisLine: {
                            show: true,
                            lineStyle: {
                                color: '#35527C'
                            }
                        },
                        axisLabel: {
                            interval: 0, //横轴信息全部显示
                            // rotate: 40, //-30度角倾斜显示
                            color: '#8697BA', //坐标的字体颜色
                            fontSize: 12
                        },
                        axisTick: {
                            show: false
                        },
                        // splitLine: {
                        //     show: true,
                        //     //  改变轴线颜色
                        //     lineStyle: {
                        //         // 使用深浅的间隔色
                        //         color: ['#35527C']
                        //     }
                        // },
                        data: xAxisdata
                    }
                ],
                yAxis: [
                    {
                        axisLine: {
                            show: true,
                            lineStyle: {
                                color: '#35527C'
                            }
                        },
                        type: 'value',

                        axisLabel: {
                            color: '#8697BA', //坐标的字体颜色
                            fontSize: 12
                        },
                        splitLine: {
                            show: false,
                            //  改变轴线颜色
                            lineStyle: {
                                // 使用深浅的间隔色
                                color: ['#35527C']
                            }
                        }
                    }
                ],
                series: seriesdata
            }
            this.centerChart4.setOption(option)
        },
        changeinit() {
            if (this.gsFlag || this.worldFlag) {
                this.gsFlag = false
                this.worldFlag = false
            } else {
                this.$router.push({
                    path: '/'
                })
            }
        }
    },
    beforeDestroy() {
        //清除定时器
        clearInterval(this.activeTimer)
        this.activeTimer = null
        clearInterval(this.worldTimer)
        this.worldTimer = null
        // 清楚所有延迟器
        clearTimeout(this.timeoutInit1)
        this.timeoutInit1 = null
        clearTimeout(this.timeoutInit2)
        this.timeoutInit2 = null
        clearTimeout(this.timeoutInit3)
        this.timeoutInit3 = null
        clearTimeout(this.timeoutInit4)
        this.timeoutInit4 = null
        clearTimeout(this.timeoutInit5)
        this.timeoutInit5 = null
        clearTimeout(this.timeoutInit6)
        this.timeoutInit6 = null
        clearTimeout(this.timeoutInit7)
        this.timeoutInit7 = null
        clearTimeout(this.timeoutInit8)
        this.timeoutInit8 = null
        this.isshowWorld = false
        console.log('定时器清楚了 了了了  了 了 了')
    }
}
</script>
  
  <style scoped lang='scss'>
.centerBox {
    width: 100%;
    vertical-align: top;
    position: relative;
    p {
        padding: 0;
        margin: 0;
    }
    .centerTop {
        width: 100%;
        display: flex;
        justify-content: space-between;
        margin-top: 70px;
        .liB {
            width: 121px;
            height: 83px;
            text-align: center;
            background-image: url('../../../assets/cockpit/boxi.png');
            background-size: cover;
            background-position: center center;
            .biao {
                font-size: 17px;
                font-weight: 400;
                color: #ffffff;
                margin-top: 8px;
            }
            .biaoNum {
                font-size: 34px;
                font-family: 'Yourname';
                font-weight: 500;
                color: #23acf3;
                margin-top: 10px;
                .unit {
                    font-size: 15px;
                    color: #ffffff;
                    font-weight: 400;
                    font-family: 'fangzheng';
                    margin-left: -4px;
                }
            }
            .t1 {
                color: #ffb33a;
            }
            .t2 {
                color: #23acf3;
            }
            .t3 {
                color: #f60783;
            }
            .t4 {
                color: #3ffdb4;
            }
            .t5 {
                color: #00f9ff;
            }
            .t6 {
                color: #ffb33a;
            }
        }
    }
    .map-container {
        width: 100%;
        height: 480px;
        margin-top: 10px;
        position: relative;

        .mapArr {
            width: 100%;
            height: 388px;
            box-sizing: border-box;
            padding: 16px 14px 19px 18px;
            display: flex;
            justify-content: space-between;
            background-image: url('../../../assets/cockpit/centBox.png');
            background-size: cover;
            background-position: center center;
            .mapItem {
                width: 377px;
                height: 100%;
                background-image: url('../../../assets/cockpit/centBg.png');
                background-size: cover;
                background-position: center center;
                position: relative;
                overflow: hidden;
                .mapItemBoxdis {
                    width: 377px;
                    height: 100%;
                    position: relative;
                    overflow: hidden;
                    position: absolute;
                    left: 0;
                    top: 0;
                    box-sizing: border-box;
                    padding: 0 10px;
                    .mapItemBoxP {
                        font-size: 18px;
                        font-family: MicrosoftYaHei;
                        background-image: -webkit-linear-gradient(
                            bottom,
                            #2bb3ff 0%,
                            #38e7ee 100%
                        );
                        -webkit-background-clip: text;
                        -webkit-text-fill-color: transparent;
                        font-weight: 600;
                        margin-bottom: 5px;
                        &.dis {
                            font-size: 14px;
                            margin-bottom: 3px;
                        }
                    }

                    .mapItemBoxinfo {
                        display: flex;
                        width: 100%;
                        margin-bottom: 5px;
                        font-size: 12px;
                        .mapItemBoxii {
                            display: flex;
                            margin-right: 10px;
                            .num {
                                font-size: 20px;
                                color: #04ccff;
                                font-family: 'Yourname';
                            }
                            .unit {
                                font-size: 12px;
                            }
                        }
                    }
                    .chartIobox1 {
                        margin-bottom: 10px;
                        margin-top: 5px;
                    }
                    .chartIobox2 {
                        margin-bottom: 10px;
                        margin-top: 5px;
                    }
                    .textINfo {
                        color: #cad6eb;
                        font-size: 12px;
                        line-height: 14px;
                        text-indent: 2em;
                        height: 56px;
                        overflow: hidden;
                    }
                }
                .mapItemBox {
                    width: 377px;
                    height: 100%;
                    position: relative;
                    overflow: hidden;
                    .elaphes {
                        position: absolute;
                        right: -10px;
                        bottom: -10px;
                        width: 80px;
                        height: 90px;
                        z-index: 9;
                        p {
                            padding: 0;
                            margin: 0;
                        }
                        .circle {
                            width: 15px;
                            height: 7px;
                            border-radius: 2px;
                            margin-right: 2px;
                        }
                        li {
                            display: flex;
                            align-items: center;
                            height: 20px;
                            font-size: 12px;
                            color: #618ab8;
                            cursor: pointer;
                        }
                    }
                }
                .borderqq {
                    border: 2px solid #0775e7;
                    position: absolute;
                    width: 300px;
                    height: 300px;
                    border-radius: 50%;
                    left: 35px;
                    top: 23px;
                    background: transparent;
                    box-shadow: 0 0 15px #0775e7;
                }
                .mapBB {
                    width: 377px;
                    height: 100%;
                    position: absolute;
                    left: 0;
                    top: 36px;
                    // z-index: -1;
                    img {
                        width: 100%;
                        height: 100%;
                    }
                }
                .mapglbg {
                    width: 100%;
                    height: 100%;
                    background-image: url('../../../assets/cockpit/DD.gif');
                    background-size: 130%;
                    background-position: -59px -73px;
                    background-repeat: no-repeat;
                }
                .worldDilog {
                    width: 235px;
                    height: 121px;
                    background-image: url('../../../assets/cockpit/dilog1.png');
                    background-size: cover;
                    background-position: center center;
                    position: absolute;
                    bottom: 4px;
                    left: 3px;
                    z-index: 3;
                    opacity: 0.8;
                    padding: 20px 10px 10px 25px;
                    box-sizing: border-box;
                    .titlew {
                        color: #ffffff;
                        font-size: 16px;
                        margin-bottom: 6px;
                        font-family: 'fangzheng';
                    }
                    .titlev {
                        color: #cdd2e1;
                        font-size: 13px;
                        line-height: 16px;
                        .colorR {
                            color: #0cdfff;
                        }
                    }
                }
                .mapzjbg {
                    width: 100%;
                    height: 100%;
                    background-image: url('../../../assets/cockpit/centR.png');
                    background-size: 95%;
                    background-position: 10px 10px;
                    background-repeat: no-repeat;
                    // background-size: cover;
                    // background-position: center center;
                    position: relative;
                    .sonDilog {
                        width: 185px;
                        height: 76px;
                        background-image: url('../../../assets/cockpit/dilog2.png');
                        background-size: cover;
                        background-position: center center;
                        position: absolute;
                        bottom: 16px;
                        left: 8px;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        z-index: 3;
                        opacity: 0.8;
                        .sonDilogtop {
                            display: flex;
                            align-items: center;
                        }
                        img {
                            width: 25px;
                            height: 25px;
                            margin-right: 10px;
                        }
                        .sonName {
                            font-size: 16px;
                            color: #04ccff;
                            font-family: 'fangzheng';

                            width: 100px;
                        }
                        .confirmT {
                            position: absolute;
                            left: 15px;
                            bottom: 18px;
                            font-size: 12px;
                            color: #04ccff;
                            font-family: 'fangzheng';
                        }
                    }
                    .goslist {
                        width: 100%;
                        height: 100%;
                        position: relative;
                        .gositem {
                            position: absolute;
                            cursor: pointer;
                            .itemname {
                                color: #6991b1;
                                font-size: 12px;
                                height: 20px;
                                line-height: 20px;
                                padding: 0 8px;
                                background: #dceef9;
                                border-radius: 10px;
                                font-weight: 500;
                            }
                            .itemicon {
                                width: 100%;
                                text-align: center;
                                margin-top: 5px;
                            }
                            img {
                                width: 29px;
                                height: 22px;
                            }
                            &.active {
                                -webkit-animation-name: scaleDraw; /*关键帧名称*/
                                -webkit-animation-timing-function: ease; /*动画的速度曲线*/
                                // -webkit-animation-iteration-count: infinite; /*动画播放的次数*/
                                -webkit-animation-iteration-count: 2; /*动画播放的次数*/
                                -webkit-animation-duration: 1.5s; /*动画所花费的时间*/
                                .itemname {
                                    // font-size: 14px;
                                    // height: 28px;
                                    // line-height: 28px;
                                    // padding: 0 12px;
                                    // border-radius: 14px;
                                    background: #4682cc;
                                    color: #cad6eb;
                                    z-index: 3;
                                }
                                // .itemicon {
                                //     margin-top: 3px;
                                // }
                                // img {
                                //     width: 28px;
                                //     height: 28px;
                                // }
                            }
                        }
                    }
                }
                .mapname {
                    width: 150px;
                    height: 24px;
                    background-image: url('../../../assets/cockpit/zhejiang.png');
                    background-size: cover;
                    background-position: center center;
                    position: absolute;
                    top: 2px;
                    right: -18px;
                    z-index: -1;
                    color: #ffffff;
                    line-height: 27px;
                    text-indent: 0.6em;
                    font-size: 14px;
                }
                .Heat {
                    width: 100%;
                    height: 100%;
                }
                .worldUl {
                    width: 100%;
                    height: 100%;
                    position: absolute;
                    left: 0;
                    top: 0;
                    .worldLi {
                        position: absolute;
                        left: 0;
                        top: 0;
                        display: none;
                        .worldLiName {
                            color: #6991b1;
                            font-size: 16px;
                            height: 22px;
                            line-height: 22px;
                            padding: 0 8px;
                            background: #dceef9;
                            border-radius: 10px;
                            font-weight: 600;
                            text-align: center;
                            opacity: 0.7;
                            width: auto;
                        }
                        .worldLiIcon {
                            width: 100%;
                            text-align: center;
                            margin-top: 10px;
                            img {
                                width: 100px;
                                height: 50px;
                            }
                        }
                        &.showl {
                            display: block;
                            -webkit-animation-name: scaleDraw; /*关键帧名称*/
                            -webkit-animation-timing-function: ease; /*动画的速度曲线*/
                            // -webkit-animation-iteration-count: infinite; /*动画播放的次数*/
                            -webkit-animation-iteration-count: infinite; /*动画播放的次数*/
                            -webkit-animation-duration: 1s; /*动画所花费的时间*/
                        }
                    }
                }
            }
        }
        .mapRoll {
            width: 100%;
            height: 103px;
            background-image: url('../../../assets/cockpit/centBot.png');
            background-size: cover;
            background-position: center center;
            position: absolute;
            left: 0;
            bottom: 9px;
            z-index: 2;
            .rolltext {
                width: 630px;
                overflow: hidden;
                height: 37px;
                line-height: 37px;
                position: absolute;
                top: 15px;
                left: 56px;
            }
            .water_text {
                white-space: nowrap;
                position: absolute;
                display: inline-block;
                top: 0px;
                animation: 16s scroll linear infinite normal;
                font-size: 18px;
                color: #ffffff;
                font-family: 'pingfang';
                letter-spacing: 1px;
            }

            @keyframes scroll {
                0% {
                    right: 0%;
                }
                100% {
                    right: 100%;
                }
            }
        }
        .recheck {
            width: 70px;
            height: 70px;
            background-image: url('../../../assets/cockpit/close.png');
            background-size: cover;
            background-position: center center;
            position: absolute;
            right: 7px;
            bottom: 45px;
            z-index: 3;
            cursor: pointer;
        }
    }
}
@keyframes shake {
    0% {
        transform: scale(0);
        transform: rotate3d(1, 1, 1, 360deg);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        transform: rotate3d(1, 1, 1, 0deg);
        opacity: 1;
    }
}
@-webkit-keyframes shake {
    0% {
        transform: scale(0);
        transform: rotate3d(1, 1, 1, 360deg);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        transform: rotate3d(1, 1, 1, 0deg);
        opacity: 1;
    }
}
@keyframes scaleDraw {
    /*定义关键帧、scaleDrew是需要绑定到选择器的关键帧名称*/
    0% {
        transform: scale(1); /*开始为原始大小*/
    }
    50% {
        transform: scale(1.2); /*放大1.1倍*/
    }
}
</style>
  